In computer science, the term “source code” refers to a collection of computer instructions written using some human-readable computer language, usually as text. The source code of a computer program is specially designed to facilitate the work of computer programmers (also referred to herein as “software developers” or simply “developers”), who specify the actions to be performed by a computer mostly by writing source code. The source code is automatically translated at some point to machine code that a computer can directly read and execute. An interpreter translates the source code to machine code and executes it on the fly when the program is run, while a compiler translates the source code in advance to machine code that it stores as executable files; these can then be executed in a separate step.
The source code that constitutes a computer program is typically held in one or more text files that are stored in some form of persistent storage. For example, source code may be stored at least temporarily on a hard disk of a developer's computer. In modern software development environments, a network-accessible source control system is often used by developers to store source code in a central repository, where it can be accessed by other developers (e.g., other members of a development team). A source control system typically provides mechanisms for checking source code in and out of the central repository. This allows different developers to work on the same project, with reduced fears of lost code or overwritten changes. Source control systems often also include a version control system that can manage files through the development lifecycle, keeping track of which changes were made, who made them, when they were made, and why.
Some source control systems enable descriptive information about source code to be stored in association with the source code. This descriptive information about source code may be referred to as “metadata”. Such metadata is typically associated with a source code file, or group of files. Conventional source control systems typically do not provide a means for associating metadata with a variety of different types of source code entities that are more granular than a file, such as classes, functions, lines, statements and expressions included within a source code file. Furthermore, the metadata is typically limited to historical information about the source code that may date back to the time the source code was first checked into the central repository.
Developers sometimes embed comments within their source code. Such comments may be used to provide historical information about the source code, describe the purpose of certain functionality within the source code, explain entity naming conventions used within the source code, or the like. Such comments may also be considered a form of metadata associated with source code. However, since comments are embedded within the source code itself, they cannot be accessed or manipulated without opening the source code file in which they are located. Furthermore, such comments must be formatted in a particular way that varies from programming language to programming language so that they can be properly handled by the interpreter or compiler that operates to convert the source code into an executable form. Finally, such comments typically comprise unstructured data. All of these features associated with comments (i.e., embedded in source code, language-specific formatting, and composed of unstructured data) limit their usefulness.